/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Persistencia.daos;

import Persistencia.CRUD;
import Persistencia.DAO;
import Persistencia.SeqHelper;
import Persistencia.modelos.Cartao;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

/**
 *
 * @author HP
 */
public class CartaoDAO implements DAO<Integer, Cartao> {

    public void salva(Cartao obj) {
        int i = SeqHelper.getId("cartao");
        CRUD.adiciona("cartao", "idCartao, cor", i + ",'" + obj.getCor() + "'");
    }

    public void atualiza(Cartao obj) {
        List<String> campos = new ArrayList<String>();
        campos.add("cor");
        List<String> valores = new ArrayList<String>();
        valores.add(obj.getCor());
        CRUD.atualiza("cartao", campos, valores, "where idCartao = " + obj.getIdCartao());
    }

    public void deleta(Integer obj) {
        List<Integer> campos = new ArrayList<Integer>();
        campos.add(obj);
        CRUD.deleta("cartao", "idCartao", campos);
    }

    public Cartao recupera(Integer obj) {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public Collection<Cartao> recuperaLista(Collection<Integer> chaves) {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public Collection<Cartao> recuperaTodos() {
        throw new UnsupportedOperationException("Not supported yet.");
    }
    
    
}
